//
//  WGuoTableViewController.swift
//  iiatn
//
//  Created by mine on 18/4/10.
//  Copyright © 2018年 mnine. All rights reserved.
//

import UIKit

class WGuoTableViewController: WCProViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        setheader()
        // 获取首页数据
        weak var weakSelf = self
        WNetwork.shareNetworkTool.loadLatPro() { (mpros) in
            weakSelf!.items = mpros
            weakSelf!.tableView!.reloadData()
        }
    }
    
    override func loadData() {
        // 获取首页数据
        weak var weakSelf = self
        WNetwork.shareNetworkTool.loadLatPro() { (mpros) in
            weakSelf!.items = mpros
            weakSelf!.tableView!.reloadData()
            weakSelf!.refreshControl?.endRefreshing()
        }
    }
    
    func setheader(){
        //给TableView添加表头页眉
//        let headerView:UIView = UIView(frame:
//            CGRect(x:0, y:0, width:tableView!.frame.size.width, height:60))
//        let headerlabel:UILabel = UILabel(frame: headerView.bounds)
//        headerlabel.textColor = UIColor.white
//        headerlabel.backgroundColor = UIColor.clear
//        headerlabel.font = UIFont.systemFont(ofSize: 16)
//        headerlabel.text = "TableView 页眉"
//        headerView.addSubview(headerlabel)
//        headerView.backgroundColor = UIColor.black
//        tableView?.tableHeaderView = headerView
    }
}
